<template></template>

<script>
// 提交失败弹窗
import { Dialog } from 'vant'
import { showService } from '_projectFn/sundry'

export default {
    name: 'SubmitFail',
    props: {
        confirmButtonText: {
            type: String,
            default: '联络在线客服'
        },
        cancelButtonText: {
            type: String,
            default: '关闭'
        },
        title: {
            type: String,
            default: ''
        },
        message: {
            type: String,
            default: '提交失败!\n请再次尝试1次或者联络在线客服'
        },
        closeOnClickOverlay: {
            type: Boolean,
            default: true,
        },
        width: {
            type: Number,
            default: 280,
        },
        showCancelButton: {
            type: Boolean,
            default: true,
        },
    },
    methods: {
        showWindow() {
            const that = this
            Dialog.alert({
                message: this.message,
                title: this.title,
                confirmButtonText: this.confirmButtonText,
                cancelButtonText: this.cancelButtonText,
                closeOnClickOverlay: this.closeOnClickOverlay,
                showCancelButton: this.showCancelButton,
                width: this.width,
                beforeClose(action, done) {
                    // console.log('action', action)
                    if (action === 'confirm') {
                        showService()
                    }
                    done()
                }
            })
        }
    },
    deactivated() {
        Dialog.close()
    },
}
</script>